import service from "@/utils/request";
const DEPT_BASE_URL = "/api/";

//品相测定列表
class Appearance {
  static getAppearanceList(queryParams?: getAppearance) {
    return service<any, getAppearance>({
      url: `${DEPT_BASE_URL}AppearanceModel/AppearanceModelList`,
      method: "post",
      data: queryParams,
    });
  }

  //羊只品种
  static AppearanceVarity() {
    return service({
      url: `${DEPT_BASE_URL}EarTage/ShowEarTageBreed`,
      method: "get",
    });
  }

  //删除品相
  static DeleteAppearance(appearanceId: number[]) {
    return service<any, any>({
      url: `${DEPT_BASE_URL}AppearanceModel/DeleteAppearanceModel`,
      method: "post",
      data: appearanceId,
    });
  }

  ///添加品相
  static AddAppearance(data: any) {
    return service({
      url: `${DEPT_BASE_URL}AppearanceModel/AddAppearanceModel`,
      method: "post",
      data,
    });
  }

  //耳号列表
  static AppearanceEarTagLisShow(presentState: any, sheepType: any) {
    return service({
      url: `${DEPT_BASE_URL}SheepFileModels/IsSexSheepfilemodel`,
      method: "get",
      params: {
        presentState: presentState,
        sheepType: sheepType,
      },
    });
  }

  //品相修改
  static UpdateAppearance(data: AddAppearance) {
    return service({
      url: `${DEPT_BASE_URL}AppearanceModel/UpdateAppearanceModel`,
      method: "post",
      data: data,
    });
  }
}

export default Appearance;
export interface getAppearance {
  pageIndex: number;
  pageSize: number;
  earTag: string;
  variety: number;
  sheepRescissionSex: any;
}

export interface AddAppearance {
  appearanceId: number;
  earTag: string;
  measureDate: Date;
  measureAge: number;
  tooth: number;
  hair: number;
  stain: number;
  hoofColor: number;
  mouthColor: number;
  angle: number;
  fatDistribution: number;
}
